import Login from "./views/Login.vue";
import Home from "./views/Home.vue";

let routes = [
  {
    path: "/",
    component: Login,
    name: "Login",
  },
  {
    path: "/Home",
    component: Home,
    name: "Home",
    children: [
      // 管理员工作台
      {
        path: "/workbench",
        name: "workbench",
        component: (resolve) =>
          require(["./views/page/workbench/workbench.vue"], resolve),
        meta: {
          requireAuth: true,
        },
      },
      {
        path: "/allHelp",
        name: "allHelp",
        component: (resolve) =>
          require(["./views/page/workbench/component/allHelp.vue"], resolve),
        meta: {
          requireAuth: true,
        },
      },
      {
        path: "/allDoing",
        name: "allDoing",
        component: (resolve) =>
          require(["./views/page/workbench/component/allDoing.vue"], resolve),
        meta: {
          requireAuth: true,
        },
      },

      // 任务管理
      {
        path: "/task",
        name: "task",
        component: (resolve) =>
          require(["./views/page/task/taskMent.vue"], resolve),
        meta: {
          requireAuth: true,
        },
      },

      // 日报管理
      {
        path: "/daily",
        name: "daily",
        component: (resolve) =>
          require(["./views/page/daily/dailyMent.vue"], resolve),
        meta: {
          requireAuth: true,
        },
      },
      {
        path: "/confirm",
        name: "confirm",
        component: (resolve) =>
          require(["./views/page/document/confirmHours.vue"], resolve),
        meta: {
          requireAuth: true,
        },
      },
      // 周报查看
      {
        path: "/weekly",
        name: "weekly",
        component: (resolve) =>
          require(["./views/page/weekly/weeklyMent.vue"], resolve),
        meta: {
          requireAuth: true,
        },
      },
      // 项目管理
      {
        path: "/project",
        name: "project",
        component: (resolve) =>
          require(["./views/page/project/projectMent.vue"], resolve),
        meta: {
          requireAuth: true,
          keepAlive: true,
        },
      },
      {
        path: "/progressManager",
        name: "progressManager",
        component: () => import("@/views/page/project/progressManager"),
        meta: {
          title: "进度管理",
          requireAuth: true,
        },
      },
      {
        path: "/projectObjectives",
        name: "projectObjectives",
        component: () => import("@/views/page/project/projectObjectives"),
        meta: {
          title: "项目目标",
          requireAuth: true,
        },
      },
      {
        path: "/progressManager/progressManagerDetail",
        name: "progressManagerDetail",
        component: () => import("@/views/page/project/progressManagerDetail"),
        meta: {
          title: "进度管理详情",
          requireAuth: true,
        },
      },
      // 公司管理
      {
        path: "/company",
        name: "company",
        component: (resolve) =>
          require(["./views/page/company/companyMent.vue"], resolve),
        meta: {
          requireAuth: true,
        },
      },
      // 人事管理
      {
        path: "/personnel",
        name: "personnel",
        component: (resolve) =>
          require(["./views/page/personnel/personnelMent.vue"], resolve),
        meta: {
          requireAuth: true,
        },
        children: [
          //职能组成员管理
          {
            path: "/member",
            name: "member",
            component: (resolve) =>
              require(["./views/page/company/member.vue"], resolve),
            meta: {
              requireAuth: true,
            },
          },
        ],
      },
      // 文档管理
      {
        path: "/document",
        name: "document",
        component: (resolve) =>
          require(["./views/page/document/documentMent.vue"], resolve),
        meta: {
          requireAuth: true,
        },
      },
      // 系统设置
      {
        path: "/system",
        name: "system",
        component: (resolve) =>
          require(["./views/page/system/systemMent.vue"], resolve),
        meta: {
          requireAuth: true,
        },
      },
      {
        path: "/suggest",
        name: "suggest",
        component: () => import("@/views/page/exchange/exchange"),
        meta: {
          title: "内部交流",
          requireAuth: true,
          keepAlive: true,
        },
      },
      {
        path: "/exchange/articleListDetail",
        name: "articleListDetail",
        component: () => import("@/views/page/exchange/articleListDetail"),
        meta: {
          title: "内部交流详情",
          requireAuth: true,
        },
      },
      //历史日报详情页
      {
        path: "/dailyDialog",
        name: "dailyDialog",
        component: (resolve) =>
          require(["./views/page/daily/dialog/dailyDialog.vue"], resolve),
        meta: {
          requireAuth: true,
        },
      },

      //项目列表查看日报

      {
        path: "/allDaily",
        name: "allDaily",
        component: (resolve) =>
          require(["./views/page/project/allDaily.vue"], resolve),
        meta: {
          requireAuth: true,
        },
      },

      //历史工作详情页
      {
        path: "/workLog",
        name: "workLog",
        component: (resolve) =>
          require(["./views/page/weekly/empWorkLog.vue"], resolve),
        meta: {
          requireAuth: true,
        },
      },

      //历史总结详情页
      {
        path: "/summaryLog",
        name: "summaryLog",
        component: (resolve) =>
          require(["./views/page/weekly/empSummaryLog.vue"], resolve),
        meta: {
          requireAuth: true,
        },
      },
       //财务
       {
        path: "/finance",
        name: "finance",
        component: (resolve) =>
          require(["./views/page/finance/financeMent.vue"], resolve),
        meta: {
          requireAuth: true,
        },
      },
      //财务工时详情页
      {
        path: "/manHourAccounting",
        name: "manHourAccounting",
        component: (resolve) =>
          require(["./views/page/finance/manHourAccounting.vue"], resolve),
        meta: {
          requireAuth: true,
        },
      },
    ],
  },
  {
    path: "*",
    hidden: true,
    redirect: {
      path: "/404",
    },
  },
];

export default routes;
